﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Caching;
using System.Configuration;

using Sita.Presentation.Models;
using Sita.Presentation.ViewModels;
using Sita.Entities;

namespace Sita.Presentation.Controllers
{
    public class SiteController : DefaultController
    {
        public ActionResult Index()
        {
            return View();
        }

        public PartialViewResult SiteHeader()
        {
            SiteHeaderModel siteHeaderData = new SiteHeaderModel();

            //siteHeaderData.CurrentModuleCode = AuthenticatedUser.CurrentModuleCode;

            foreach (Module mod in AuthenticatedUser.Modules)
            {
                siteHeaderData.Modules.Add(new ModuleShortInfo { ModuleID = mod.ModuleID, ModuleName = mod.Name, TargetAction = mod.TargetAction, TargetController = mod.TargetController, ModuleCode = mod.Code });
            }

            return PartialView("SiteHeader", siteHeaderData);
        }
    }
}
